'use strict';
$(document).ready(function () {
    // console.log($('.card-toolbar.clearfix')[0]);
    let toolbar_height = 0;
    if ($('.card-toolbar.clearfix')[0]) {
        toolbar_height = parseInt($('.card-toolbar.clearfix')[0].offsetHeight);
    }
    let other_height = 68 + 15 + toolbar_height + 5 + 40 + 31 + 5 + 15;

    // 页面上只有一个表格时
    $('.table-one').DataTable({
        scrollY: "calc(100vh - "+other_height+"px)",  //表格内容部分高度设置为窗口高度-100px
        scrollX: true,
        info: false,
        paging: false,
        ordering: false,
        searching: false,
        autoWidth: false,
        // scrollCollapse: true,  //表格高度随内容自适应
        language: {
            emptyTable: "暂无数据",
        }
    });

    other_height = other_height + 280;
    $('.table-head').DataTable({
        scrollY: "calc(100vh - "+other_height+"px)",  //表格内容部分高度设置为窗口高度-100px
        scrollX: true,
        info: false,
        paging: false,
        ordering: false,
        searching: false,
        autoWidth: false,
        // scrollCollapse: true,  //表格高度随内容自适应
        language: {
            emptyTable: "暂无数据",
        }
    });

    $('.table-detail').DataTable({
        scrollY: "200px",  //表格内容部分高度设置为窗口高度-100px
        scrollX: true,
        info: false,
        paging: false,
        ordering: false,
        searching: false,
        autoWidth: false,
        // scrollCollapse: true,  //表格高度随内容自适应
        language: {
            emptyTable: "暂无数据",
        },
    });
});